package com.maple.soa.util;

import java.nio.charset.Charset;
import java.util.Base64;

/**
 * @author lijian
 * @date 2020/5/27
 */
public class Base64Utils {

    public static Base64Utils getInstance() {
        return new Base64Utils();
    }

    public String encryptBase64(String data) {
        return Base64.getEncoder().encodeToString(data.getBytes());
    }

    public String decryptBase64(String data) {
        byte[] decryptByte = Base64.getDecoder().decode(data.getBytes());
        return new String(decryptByte);
    }

}
